<?php

class Form
{
	static public function select($name, $arr, $propriedades = null, $selected = null)
	{
		foreach ($arr as $key => $val)
		{
			$s = "";
			
			if ($selected == $key)
			{
				$s = "selected='selected'";
			}
			
			$html_options .= "<option $s value=\"$key\">$val</option>";
		}
		
		if(is_array($propriedades))
		{
			foreach ($propriedades as $key => $val)
			{
				$p .= "$key='$val' ";
			}
		}
		
		$html = "<select $p name=\"$name\" id=\"$name\">
					$html_options
				</select>";
		
		return $html;
	}
}

?>
